home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
byteibm.arc
/
CLAFF.ARC
/
LISTING4.DOC
< prev
Wrap
Text File
|
1985-07-12
|
2KB
|
130 lines
;=======VECTOR STRUCTURE
VECTOR STRUC
REGIP DW ?
REGCS DW ?
VECTOR ENDS
;=======PSP SEGMENT
PSP SEGMENT AT 0FFFFH
; PROGRAM SEGMENT PREFIX
INCLUDE PSP.INC
PSP ENDS
;=======DATA SEGMENT
DATA SEGMENT PUBLIC 'DATA'
EXTRN CLKDIV:WORD
EXTRN CLKRTN:WORD
COL DB 0 ;COLUMN
DIR DB 1 ;DIRECTION
LEFT DB ? ;NUMBER LEFT
COLS DB ? ;LAST COLUMN (0 RELATIVE)
SPEED DW 1000000000000000B ;SPEED MASK
DEEPS DW 0000000000000001B ;BACKWARDS!
DATA ENDS
;=======STACK SEGMENT
STACK SEGMENT STACK 'STACK'
DW 128 DUP(?)
STACK ENDS
;=======CODE SEGMENT
CODE SEGMENT PUBLIC 'CODE'
ASSUME CS:CODE,DS:PSP,ES:PSP,SS:STACK
EXTRN CLKEPI:NEAR
EXTRN CLKPRO:NEAR
DOSCALL VECTOR <> ;WILL POINT TO
; PSP:DOS_CALL
SEGCODE DW CODE ;CODE SEGMENT
PUBLIC SEGCODE
SEGDATA DW DATA ;DATA SEGMENT
PUBLIC SEGDATA
IP LABEL NEAR ;EXECUTION STARTS HERE
;-------SETUP DOSCALL VECTOR
MOV DOSCALL.REGIP,OFFSET DOS_CALL
MOV DOSCALL.REGCS,DS
;-------SETUP DS AND ES REGISTERS
MOV ES,SEGDATA
ASSUME ES:DATA
MOV DS,SEGDATA
ASSUME DS:DATA
;-------DETERMINE LAST COLUMN
MOV AH,00FH
INT 010H
DEC AH
MOV COLS,AH
MOV LEFT,AH
;-------INITIALIZE CLK MODULE
CALL CLKPRO
;-------SET CLOCK ROUTINE
MOV CLKRTN,OFFSET INT08
JMP SHORT SETRATE
MAINX LABEL NEAR
CALL CLKEPI ;DEINSTALL CLK MODULE
;-------RETURN TO DOS
MOV AH,000H
CALL DOSCALL
;-------SET CLK RATE
SETRATE LABEL NEAR
MOV AX,SPEED
OR AX,DEEPS
AND AX,1111111100000000B
SHL AX,1
MOV CLKDIV,AX
;-------WAIT FOR KEYSTROKE
KEY LABEL NEAR
MOV AH,0
INT 016H
CMP AL,01BH
JE MAINX ;EXIT ON ESCAPE
ROR SPEED,1 ;OTHERWISE,
ROL DEEPS,1 ; CHANGE SPEED
JMP SETRATE
;*******INTERRUPT ROUTINE
ASSUME CS:CODE,DS:DATA,ES:DATA,SS:NOTHING
; NEAR PROC CALLED BY INT08
INT08 PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH BP
PUSH SI
PUSH DI
;-------POSITION CURSOR
MOV AH,002H
MOV BH,0
MOV DH,0
MOV DL,COL
INT 010H
;-------DERIVE CHARACTER FROM TIME OF DAY
MOV AH,0
INT 01AH
MOV AL,DL
AND AL,00111111B
ADD AL,' '
;-------PUT CHARACTER ON THE SCREEN
MOV AH,00AH
MOV BH,0
MOV CX,1
INT 010H
;-------UPDATE COLUMN
MOV AL,DIR
ADD COL,AL
DEC LEFT
JNZ SHOWX
NEG DIR
MOV AL,COLS
MOV LEFT,AL
SHOWX LABEL NEAR
POP DI
POP SI
POP BP
POP DX
POP CX
POP BX
POP AX
RET
INT08 ENDP
CODE ENDS
END IP